package com.lzjy.tw.composedemo.di

import android.content.Context
import com.lzjy.tw.composedemo.domain.dao.TestDao
import com.lzjy.tw.composedemo.domain.repository.TestRepository
import com.lzjy.tw.composedemo.repository.NoteRepository
import com.lzjy.tw.composedemo.repository.impl.INoteRepository
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton


@Module
@InstallIn(SingletonComponent::class)
object RepositoryModule {
    @Singleton
    @Provides
    fun provideNoteRepository(
        @ApplicationContext context: Context,
        testRepository: TestRepository
    ): INoteRepository {
        return NoteRepository(context, testRepository)
    }


    @Singleton
    @Provides
    fun provideTestRepository(
        dao: TestDao
    ): TestRepository {
        return TestRepository(dao)
    }

}